import random
import time

money = 1000
while 1 :
    if money < 100:
        print("你的金豆余额不足,将退出游戏".center(25, " "))
    else:
        select = input("猜大小游戏，任意键开始,输入exit退出".center(25, " "))
        if select == "exit":
            exit()
        else:
            i = input("请输入大小".center(25," "))
            x = random.randint(1, 6)
            y = random.randint(1, 6)
            z = random.randint(1, 6)
            sum = x + y + z
            if 3 <= sum <= 10 :
                result = "小"
            else:
                result = "大"
            if i == result:
                print(f"恭喜你猜对了,结果为:{result}".center(25, " "))
                money = money + 100
            else:
                print(f"很遗憾你猜错了,结果为:{result}".center(25, " "))
                money = money - 100
            print(f"金豆余额:{money}".center(25, " "))
            time.sleep(1)